/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.kamen.gesplan.vistes;

import java.awt.Dimension;
import java.awt.Toolkit;

/**
 *
 * @author Roger
 */
public class Start extends javax.swing.JFrame {

    
    private int action = 0;
    private boolean closed = false;
    /**
     * Creates new form Start
     */
    public Start() {
        initComponents();
        
        Dimension pantalla = Toolkit.getDefaultToolkit().getScreenSize();
        Dimension finestra = getSize();
        this.setLocation((pantalla.width - finestra.width) / 2,(pantalla.height - finestra.height) / 2);
        setVisible(true);
        setResizable(false);
        this.setTitle("Menú principal");
    }

    public int getAction() {
        return action;
    }

    public void setAction(int action) {
        this.action = action;
    }

    public boolean isClosed() {
        return closed;
    }

    public void setClosed(boolean closed) {
        this.closed = closed;
    }

    
    
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        afegir = new javax.swing.JButton();
        esborrar = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                formWindowClosing(evt);
            }
        });

        afegir.setText("Afegir Empleat");
        afegir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                afegirActionPerformed(evt);
            }
        });

        esborrar.setText("Esborrar Empleat");
        esborrar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                esborrarActionPerformed(evt);
            }
        });

        jLabel1.setFont(new java.awt.Font("Segoe Condensed", 1, 36)); // NOI18N
        jLabel1.setText("Gesplan");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(47, 47, 47)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(afegir, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(esborrar, javax.swing.GroupLayout.DEFAULT_SIZE, 175, Short.MAX_VALUE)))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(70, 70, 70)
                        .addComponent(jLabel1)))
                .addContainerGap(42, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(38, 38, 38)
                .addComponent(jLabel1)
                .addGap(48, 48, 48)
                .addComponent(afegir)
                .addGap(45, 45, 45)
                .addComponent(esborrar)
                .addContainerGap(44, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
        closed = true;
    }//GEN-LAST:event_formWindowClosing

    private void afegirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_afegirActionPerformed
        action = 1;
    }//GEN-LAST:event_afegirActionPerformed

    private void esborrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_esborrarActionPerformed
        action = 2;
    }//GEN-LAST:event_esborrarActionPerformed

   
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton afegir;
    private javax.swing.JButton esborrar;
    private javax.swing.JLabel jLabel1;
    // End of variables declaration//GEN-END:variables
}
